project(matrix_multiply)
cmake_minimum_required(VERSION 2.8)
FIND_PACKAGE(OpenMP REQUIRED)

#if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
#endif()


find_package(CUDA REQUIRED)
#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_21)

#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35)


set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mavx")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mavx")
#aux_source_directory(. SRC_LIST)
INCLUDE_DIRECTORIES(./include)


#file(GLOB_RECURSE CURRENT_HEADERS  *.h *.hpp *.cuh)
#file(GLOB CURRENT_SOURCES *.cu)
#source_group("Include" FILES ${CURRENT_HEADERS})
#source_group("Source" FILES ${CURRENT_SOURCES})

#CUDA_ADD_EXECUTABLE(${PROJECT_NAME} ${CURRENT_HEADERS} ${CURRENT_SOURCES})


##add_executable(${PROJECT_NAME} ${SRC_LIST} )

INCLUDE(/usr/share/cmake-3.5/Modules/FindCUDA.cmake)
CUDA_ADD_EXECUTABLE(${PROJECT_NAME} main.cpp multiply_gpu.cu utils.cpp)
